-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Elastic-Agent] Do not use unversioned home with watcher binary path #25423
[Elastic-Agent] Do not use unversioned home with watcher binary path #25423
Conversation
Pinging @elastic/ingest-management (Team:Ingest Management) |
Pinging @elastic/agent (Team:Agent) |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
@blakerouse should i do this or should we move binary/create symlink in the setPath func |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michalpristas Can you reference the issue this is coming from?
@@ -200,8 +200,8 @@ func (p *noopPidProvider) Name() string { return "noop" } | |||
|
|||
func (p *noopPidProvider) PID(ctx context.Context) (int, error) { return 0, nil } | |||
|
|||
func invokeCmd() *exec.Cmd { | |||
homeExePath := filepath.Join(paths.Home(), agentName) | |||
func invokeCmd(topPath string) *exec.Cmd { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw the name topPath in the past? What does it exactly mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with the structure we have topPath is the top of agent directory structure e.g. /etc/Elastic/Agent
we also use a homePath which points to a home of a certain agent version e.g /etc/Elastic/Agent/data/elastic-agent-abc123/
As a follow up, we should start to think on how we can test these things in an automated way. |
The only time unversioned path is used is in the container. Self-upgrade is not supported in the container anyway, so could we just disable the watcher completely instead? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change does seem okay and should still go in.
But related to my previous comment, when will the watcher run in a container?
@blakerouse it will not, the only case when it's running is when specifically told to using DEV flag [allowUpgrade part] |
What does this PR do?
The problem is when agent tries to invoke watcher which checks upgraded agent for failures and at the same time unversioned home path is set.
Usually agent took its home path which is
{top_path}/data/elastic-agent-{hash}/elastic-agent
and invokedwatch
sub-command on binary at that path.When unversioned path is set it tries to run watcher from
{top_path}/data/elastic-agent
and as so it results in binary not found.Fixes: #25371
Why is it important?
Reduce noise created by failng attempt to run this. This is just a case when running
container
sub-command which tempers paths.Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.cc @michel-laterman